package com.ruoyi.bus;

import com.ruoyi.common.core.domain.R;
import com.ruoyi.entity.BusTaskEntity;
import com.ruoyi.entity.mapper.BusTaskMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 任务工具类
 */
@RequestMapping("/task")
@RestController
public class TaskController {

    @Autowired
    public BusTaskMapper mapper;

    //获取任务列表
    @PostMapping("/list")
    @ResponseBody
    public R<String> list(@RequestHeader("userId") String userId)
    {
        return R.ok("");

    }

    //添加任务
    @PostMapping("/add")
    @ResponseBody
    public R<Integer> add(@RequestBody BusTaskEntity entity)
    {
        Integer result = mapper.insertTask(entity);
        return R.ok(result);
    }
    //编辑任务
    @PostMapping("/edit")
    @ResponseBody
    public R<String> edit()
    {
        return R.ok("");
    }
}
